const result = JSON.parse(window.localStorage.getItem("result"))
let user = result == null ? {} : result.user
console.log("取值",user)

const state = { 
    user:user
}

console.log("state",state)
const userStore = { 
    namespaced:true,
    action:{ 

    },

    mutations:{ 
        /**
         * 设置vuex中的user值
         * @param {*} state 
         * @param {*} user 
         */
        setUser(state,user) { 
            console.log("执行setUser user = ",user)
            console.log("执行setUser state = ",state)
            state.user = {...user}
        }
    },

    getters:{ 

    },
    
    state
}

console.log("userStore",userStore)

export default userStore